﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="abmSocio.aspx.cs" Inherits="abmSocio" %>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContenido" Runat="Server">
    <asp:Panel ID="pnlAlta" runat="server" Visible="False" Width="397px">
    <table class="style32">
        <tr>
            <td class="style22">
                Socio</td>
            <td class="style30">
                </td>
            <td class="style47">
                </td>
            <td class="style47">
                </td>
        </tr>
        <tr>
            <td class="style24">
                Nombre:</td>
            <td class="style25">
                <asp:TextBox ID="txtNombre" runat="server"></asp:TextBox>
            </td>
            <td class="style26">
                <asp:RequiredFieldValidator ID="rfvNombre" runat="server" 
                    ControlToValidate="txtNombre" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
            </td>
            <td class="style26">
                <asp:HiddenField ID="txtId" runat="server" />
                </td>
        </tr>
        <tr>
            <td class="style31">
                Apellido:</td>
            <td class="style30">
                <asp:TextBox ID="txtApellido" runat="server"></asp:TextBox>
            </td>
            <td class="style47">
                <asp:RequiredFieldValidator ID="rfvApellido" runat="server" 
                    ControlToValidate="txtApellido" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
                </td>
            <td class="style47">
                </td>
        </tr>
        <tr>
            <td class="style31">
                DNI:</td>
            <td class="style30">
                <asp:TextBox ID="txtDni" runat="server"></asp:TextBox>
            </td>
            <td class="style47">
                <asp:RequiredFieldValidator ID="rfvDni" runat="server" 
                    ControlToValidate="txtDni" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cvDni" runat="server" ControlToValidate="txtDni" 
                    ErrorMessage="CompareValidator" Operator="GreaterThan" Type="Integer" 
                    ValueToCompare="0">*</asp:CompareValidator>
                </td>
            <td class="style47">
                </td>
        </tr>
        <tr>
            <td class="style31">
                Fecha de Nacimiento:</td>
            <td class="style30">
                <asp:TextBox ID="txtFechaNacimiento" runat="server"></asp:TextBox>
            </td>
            <td class="style47">
                (dd/mm/aaaa)<asp:CompareValidator ID="cvFecNac" runat="server" 
                    ControlToValidate="txtFechaNacimiento" ErrorMessage="CompareValidator" 
                    Operator="GreaterThan" Type="Date" ValueToCompare="01/01/1800">*</asp:CompareValidator>
                </td>
            <td class="style47">
               </td>
        </tr>
        <tr>
            <td class="style31">
                Telefono:</td>
            <td class="style30">
                <asp:TextBox ID="txtTelefono" runat="server"></asp:TextBox>
            </td>
            <td class="style47">
               </td>
            <td class="style47">
               </td>
        </tr>
        <tr>
            <td class="style31">
                Mail:</td>
            <td class="style30">
                <asp:TextBox ID="txtMail" runat="server"></asp:TextBox>
            </td>
            <td class="style47">
                <asp:RegularExpressionValidator ID="revMail" runat="server" 
                    ControlToValidate="txtMail" ErrorMessage="RegularExpressionValidator" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
            </td>
            <td class="style47">
            </td>
        </tr>
        <tr>
            <td class="style31">
             </td>
            <td class="style30">
                <asp:Button ID="btnAgregar" runat="server" Text="Agregar Socio" 
                    onclick="btnAgregar_Click" />
            </td>
            <td class="style47">
                <asp:Button ID="btnModificar" runat="server" Text="Modificar Socio" 
                    onclick="btnModificar_Click" style="text-align: left" />
            </td>
            <td class="style47">
             </td>
        </tr>       
        <tr>
            <td class="style31" colspan="3">
             </td>
            <td class="style31">
             </td>
        </tr>  
        </table> 
    </asp:Panel>    
    <asp:Panel ID="pnlUsuario" runat="server" Height="164px" Visible="False" 
    Width="394px">
        <table class="style1">
            <tr>
                <td class="style48">
                    Datos del Usuario</td>
                <td class="style50">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style49">
                    Usuario:</td>
                <td class="style50">
                    <asp:Label ID="lblUsuario" runat="server" Enabled="False"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style49">
                    Clave:</td>
                <td class="style50">
                    <asp:TextBox ID="txtClave" runat="server" TextMode="Password">Ingrese clave</asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="rfvClave" runat="server" 
                        ControlToValidate="txtClave" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style49">
                    Repetir Clave:</td>
                <td class="style50">
                    <asp:TextBox ID="txtRepetirClave" runat="server" TextMode="Password"></asp:TextBox>
                </td>
                <td>
                    <asp:Label ID="lblMje" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="style49">
                    Rol:</td>
                <td class="style50">
                    <asp:Label ID="lblRol" runat="server" Enabled="False"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style49">
                    &nbsp;</td>
                <td class="style50">
                    &nbsp;</td>
                <td>
                    <asp:Button ID="btnAceptar" runat="server" onclick="btnAceptar_Click" 
                        Text="Aceptar" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="pnlListado" runat="server">
        <table class="style35">
            <tr>
                <td class="style45">
                    DNI:</td>
                <td class="style41">
                    <asp:TextBox ID="txtDniSocio" runat="server"></asp:TextBox>
                </td>
                <td class="style38">
                    <asp:Button ID="btnConsultar" runat="server" style="margin-left: 0px" 
                        Text="Consultar" onclick="btnConsultar_Click" />
                </td>
                <td class="style39">
                    <asp:Button ID="btnNuevoSocio" runat="server" Text="Nuevo Socio" 
                        onclick="btnNuevoSocio_Click" />
                </td>
            </tr>
            <tr>
                <td class="style37" colspan="4">
                    <asp:GridView ID="dgvSocio" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="id" CellSpacing="1" HorizontalAlign="Left" 
                        AllowPaging="True" onpageindexchanging="dgvProfesores_PageIndexChanging" 
                        PageSize="5">
                        <Columns>
                            <asp:BoundField DataField="Nombre" HeaderText="Nombre" NullDisplayText="-" >
                            <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Apellido" HeaderText="Apellido" />
                            <asp:BoundField DataField="dni" HeaderText="DNI" NullDisplayText="-" />
                            <asp:BoundField DataField="fechanacimiento" HeaderText="Fecha Nacimiento" >
                            <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="telefono" HeaderText="Telefono" />
                            <asp:BoundField DataField="Usuario.Nombre" HeaderText="Usuario" 
                                NullDisplayText="-" >
                            <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Modificar">
                                <ItemTemplate>
                                    <asp:Button ID="btnModificar" runat="server" Text="Modificar"
                                    CommandName="Modificar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
                                    oncommand="btnEliminar_Command" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Eliminar">
                                <ItemTemplate>
                                    <asp:Button ID="btnEliminar" runat="server" CommandName="Eliminar" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
                                     onclientclick="if(!confirm('¿Dar de baja actividad seleccionada?')){return false;}" 
                                     style="margin-left: 0px" Text="Eliminar" oncommand="btnEliminar_Command"/>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>            
        </table>
        <table>
        <tr>
                <td class="style43">
                    <br />
                    <asp:Label ID="lblError" runat="server"></asp:Label>
                </td>
            </tr>
            </table>
     </asp:Panel>
</asp:Content>

<asp:Content ID="Content3" runat="server" contentplaceholderid="head">
    <style type="text/css">
        .style22
        {
            width: 132px;
        }
        .style24
        {
            text-align: right;
            width: 132px;
            height: 37px;
        }
        .style25
        {
            text-align: right;
            height: 37px;
            width: 160px;
        }
        .style26
        {
            text-align: left;
            width: 117px;
            height: 37px;
        }
        .style30
        {
            text-align: right;
            width: 160px;
        }
        .style31
        {
            text-align: right;
        }
        .style32
        {
            width: 476px;
            height: 216px;
        }
        .style35
        {
            width: 599px;
        }
        .style37
        {
            text-align: right;
            width: 543px;
        }
        .style38
        {
            text-align: left;
            width: 104px;
        }
        .style39
        {
            width: 192px;
        }
        .style41
        {
            text-align: right;
            width: 229px;
        }
        .style43
        {
            text-align: left;
            height: 22px;
            width: 594px;
        }
        .style45
        {
            text-align: right;
            width: 37px;
        }
        .style47
        {
            text-align: left;
            width: 117px;
        }
        .style48
    {
        width: 121px;
    }
    .style49
    {
        width: 121px;
        text-align: right;
    }
    .style50
    {
        width: 136px;
    }
        </style>
</asp:Content>


